const componentGen = require('./scripts/component')
const pageGen = require('./scripts/page')

module.exports = (api, projectOptions) => {
    api.registerCommand('gen', {
        description: 'gen plugin for vue cli 3',
        usage: 'vue-cli-service gen',
        options: {

        }
    }, (args) => {
        const t = args.t ? args.t : process.env.npm_config_t
        const name = args.name ? args.name : process.env.npm_config_name
        if (t === 'c') {
            componentGen(name)
        }
        if (t === 'p') {
            pageGen(name)
        }
    })
}